<!DOCTYPE html>
<div id="element"></div>
<pre id="output"></pre>
<script>
if (window.testRunner) {
  testRunner.dumpAsText();
}

function print(text) {
  output.textContent += text + '\n';
}

print('This test documents Blink\'s web-exposed CSS properties.');
print('All changes to this list should go through Blink\'s feature review process: http://www.chromium.org/blink#new-features');
print('');

let style = element.style;

function isExposedProperty(property) {
  style[property] = 'inherit';
  let isExposed = style.length > 0;
  style.cssText = '';
  return isExposed;
}

function getLonghands(shorthand) {
  style[shorthand] = 'inherit';
  let longhands = Array.from(style);
  longhands.sort();
  style.cssText = '';
  return longhands;
}

function getAliasedProperty(alias) {
  style[alias] = 'inherit';
  let aliasedProperty = /([\w-]+):/.exec(style.cssText)[1];
  style.cssText = '';
  return aliasedProperty;
}

print('[LONGHANDS]');
for (let longhand of internals.getCSSPropertyLonghands().sort()) {
  if (!isExposedProperty(longhand)) {
    continue;
  }
  print('    ' + longhand);
}
print('');

print('[SHORTHANDS]');
for (let shorthand of internals.getCSSPropertyShorthands().sort()) {
  if (!isExposedProperty(shorthand)) {
    continue;
  }
  print('    ' + shorthand);
  for (let longhand of getLonghands(shorthand)) {
    print('        ' + longhand);
  }
}
print('');

print('[ALIASES]');
for (let alias of internals.getCSSPropertyAliases().sort()) {
  if (!isExposedProperty(alias)) {
    continue;
  }
  print('    ' + alias);
  print('        ' + getAliasedProperty(alias));
}

</script>
